#!/bin/env python3
# -*- coding:utf-8 -*-
"""
    [模块名]
    Add By :e4ting e4ting@gmail.com 2023-09-24 16:33:29
"""
import sys,os
import json,time
from pdb import set_trace as strace
from traceback  import format_exc as dumpstack
from textwrap import dedent

from flask_restful import Resource
from flask         import redirect,request,make_response

from core.webhook import Robot,MessageTemp

class WebRobotTypes(Resource):
    ''' 机器人种类 '''
    #----------------------------------------------------------------------
    def __init__(self):
        super(WebRobotTypes, self).__init__()

    def get(self, **kwargs):
        Types = Robot.Types()
        data = [ dict(value=Type.name, label=Type.__doc__, text=Type.__doc__) for Type in Types]
        return dict(code=200, data=data, total=len(data))

